import React from 'react';
import { connect } from 'dva'
import { Button, List, WhiteSpace, TextareaItem ,InputItem } from 'antd-mobile';
import banner from '../../../../assets/work/dsb.jpg';
import styles from './transferdetails.less';


const Item = List.Item;
const Brief = Item.Brief;
class transferdetails extends React.Component {
  constructor(props) {
    super(props);
    this.state = {}
    this.props.dispatch({
      type: 'transferdetails/fetch',
      payload: {id: this.props.location.query.id},
    });
  }

  render() {

    return (
      <div>
        {this.props.list &&
        <List className="my-list">
          <Item style={{width: '90%', display: 'inline-block'}} extra={<div  style={{
            width: '1.5rem',
            transform: 'rotate(-45deg)',
            height: '1rem',
            textAlign: 'center',
            marginLeft: '1.5rem',
            fontSize: '0.4rem'
          }}><span style={{fontSize: '0.3rem', color: '#55A0FE'}}>{this.props.list.transfer.status_text}</span></div>}>
            <span>由</span>&nbsp;&nbsp;<span
            style={{fontSize: '0.3rem', color: '#666'}}>{this.props.list.transfer.origin_org_name}</span>
            <Brief><span>转至</span>&nbsp;&nbsp;<span
              style={{fontSize: '0.3rem', color: '#333'}}>{this.props.list.transfer.goal_org_name}</span></Brief>
          </Item>
        </List>
        }
        <WhiteSpace/>
        {this.props.list &&
        <List className="superior_list">
          <Item extra={this.props.list.transfer.apply_time} style={{fontSize: '0.3rem'}}><img src={banner} style={{
            width: '0.8rem',
            height: '0.8rem'
          }}/>&nbsp;&nbsp; {this.props.list.top_audit_org.secretary}&nbsp;&nbsp;处理中</Item>
        </List>
        }
        {this.props.list &&
        <List className="inferiors_list">
          <Item extra={this.props.list.transfer.apply_time_string} style={{fontSize: '0.3rem'}}>
            <img src={banner} style={{width: '0.8rem', height: '0.8rem'}}/> &nbsp;&nbsp;{this.props.list.transfer.name}提交了转接申请</Item>
        </List>
        }
      </div>
    )
  }
}
function mapStateToProps({transferdetails}) {
  console.log(transferdetails);
    return {
      list: transferdetails.transferInfo
    }
}
export default connect(mapStateToProps)(transferdetails);
